package com.weifangfirecontrolformal.weifangfirecontrolformal.web.web.maintenancesystem.basisinfo;

import cn.hutool.json.JSONObject;
import com.weifangfirecontrolformal.weifangfirecontrolformal.common.base.BaseController;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.Action;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.At;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.model.RespEntity;
import com.weifangfirecontrolformal.weifangfirecontrolformal.web.service.maintenancesystem.basisinfo.OrganizationMaintenanceService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;

/**
 * @Author: YangYu
 * @ClassName: OrganizationMaintenanceController
 * @Date: Created in 9:58 2021/1/26
 * @Description: 维保机构
 */
@Action
@RequestMapping(value="basisinfo/organizationmaintenance")
public class OrganizationMaintenanceController extends BaseController {

    @Resource
    private OrganizationMaintenanceService organizationMaintenanceService;

    /**
     * @Author YangYu
     * @Description 维保机构分页列表
     * @Date Created in 16:40 2020/12/22
     * @Param [jsonParam]
     */

    @At(value = "organizationMaintenancePagList", method = RequestMethod.GET, param = { "page","limit"})
    public RespEntity organizationMaintenancePagList(@RequestBody(required = false) JSONObject jsonParam) {
        return organizationMaintenanceService.organizationMaintenancePagList(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 维保机构新增
     * @Date Created in 14:04 2020/12/24
     * @Param [jsonParam]
     */

    @At(value = "add", method = RequestMethod.POST)
    public RespEntity add(@RequestBody(required = false) JSONObject jsonParam) {
        return organizationMaintenanceService.add(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 维保机构更新
     * @Date Created in 14:05 2020/12/24
     * @Param [jsonParam]
     */

    @At(value = "update", method = RequestMethod.POST)
    public RespEntity update(@RequestBody(required = false) JSONObject jsonParam) {
        return organizationMaintenanceService.update(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 维保机构详情
     * @Date Created in 14:05 2020/12/24
     * @Param [jsonParam]
     */

    @At(value = "detail", method = RequestMethod.GET)
    public RespEntity detail(@RequestBody(required = false) JSONObject jsonParam) {
        return organizationMaintenanceService.detail(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 维保机构删除
     * @Date Created in 14:06 2020/12/24
     * @Param [jsonParam]
     */

    @At(value = "delete", method = RequestMethod.POST)
    public RespEntity delete(@RequestBody(required = false) JSONObject jsonParam) {
        return organizationMaintenanceService.delete(jsonParam);
    }
}
